@extends('layouts.public')

@section('bodyattr')class="gray-bg"@endsection

@section('body')
    <div class="wrapper wrapper-content">
        <div class="row m-b">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="{{route('admin.money.moneys')}}">提现列表</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <form role="form" class="form-inline" method="get">
                            <div class="form-group">
                                <label class="sr-only">姓名</label>
                                <input type="text" name="title" placeholder="请输入众筹主题" class="form-control"
                                       value="{{request('title')}}">
                            </div>
                            <div class="form-group">
                                <input placeholder="手机号" class="form-control"  type="text"
                                       name="order_sn" value="{{request('order_sn')}}" style="width: 200px;"
                                       autocomplete="off">
                            </div>
                            <button type="submit" class="btn btn-primary">搜索</button>
                            <button type="button" class="btn btn-white"
                                    onclick="location.href='{{route('admin.order.orders')}}'">重置
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                            <thead>
                            <tr role="row">
                                <th>提现ID</th>
                                <th>账户</th>
                                <th>账号</th>
                                <th>银行</th>
                                <th>银行支行</th>
                                <th>金额</th>
                                <th>状态</th>
                                <th>原因</th>
                                <th class="sorting" orderby="created_at">提现时间</th>
                            </tr>
                            </thead>
                            @foreach($orders as $user)
                                <tr class="gradeA">
                                    <td>{{$user['id']}}</td>
                                    <td>{{$user['order_sn']}}</td>
                                    <td>
                                        {{$user['nickname']}}
                                    </td>
                                    <td>
                                        {{$user['nickname']}}
                                    </td>
                                    <td>
                                        {{$user['money']}}
                                    </td>
                                    <td>{{$user['total']}}</td>
                                    <td>{{$user['num']}}</td>
                                    <td>
                                        <div class="item">
                                        @foreach(explode(',',$user['donate_avatar']) as $g)
                                            <span>
                                                <img src="{{$g}}" alt="">
                                            </span>
                                        @endforeach
                                        </div>
                                        <div class="item">
                                        @foreach(explode(',',$user['donate_nickname']) as $g)
                                            <span>
                                                {{$g}}
                                            </span>
                                        @endforeach
                                        </div>
                                    </td>
                                    <td>
                                        @if($user['status']==4)
                                        <span style="color:green">已完成</span>
                                        @endif
                                        @if($user['status']==2)
                                        <span style="color:gray">已取消</span>
                                        @endif
                                        @if($user['status']==1)
                                        <span style="color:gray">进行中</span>
                                        @endif
                                    </td>
                                    <td>{{$user['created_at']}}</td>
                                </tr>
                            @endforeach
                        </table>
                        <div class="row">
                            <div class="col-sm-12">
                                <div>共 {{ $orders->total() }} 条记录</div>
                                {!! $orders->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('script')
    <script type="text/javascript" src="{{cdn('js/plugins/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        laydate.render({
            elem: '#created_at',
            range: true,
            max: 0
        });
    </script>
@endsection
